# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kauth
pkgver=5.95.0
pkgrel=0
pkgdesc="Abstraction to system policy and authentication features"
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by polkit
arch="all !armhf !s390x !riscv64"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends_dev="
	kcoreaddons-dev
	polkit-qt-1-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt5-qttools-dev
	samurai
	"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kauth-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	cd build
	# KAuthHelperTest hangs
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E '(KAuthHelperTest)'
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d15fcfa0970e386cf34786a17eade0c2336668b192eca4ae358db45252a56714f45ba2c2baa87a1c0a51640ba695543c96df242c138f1195dbb5d5ac25352d45  kauth-5.95.0.tar.xz
"
